package com.wetalk.api.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author tzy
 * @since 2024-08-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
@ApiModel(value="Users对象", description="用户表")
public class Users implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id,不填,自动创建")
    private Integer id;

    @ApiModelProperty(value = "用户名,必填")
    private String username;

    @ApiModelProperty(value = "密码,必填")
    private String password;

    @ApiModelProperty(value = "注册时间,自动创建")
    private LocalDateTime registrationDate;

    @ApiModelProperty(value = "状态,自动创建,默认为0")
    private Boolean state;

    @ApiModelProperty(value = "头像url,可不填")
    private String avatarUrl;

    @ApiModelProperty(value = "个人介绍,可不填")
    private String bio;

    public Users(String username, String password){
        this.username = username;
        this.password = password;
    }

    public Users(Integer id, String username, String password){
        this.id = id;
        this.username = username;
        this.password = password;
    }

    public void UsersCopy(Users users){
        this.id = users.getId();
        this.username = users.getUsername();
        this.password = users.getPassword();
        this.registrationDate = users.getRegistrationDate();
        this.state = users.getState();
        this.avatarUrl = users.getAvatarUrl();
        this.bio = users.getBio();
    }

}
